<?

include('custom/partytabs.php');
$_SESSION['invite'] = array();

$inv = array();
foreach($this->model->invList as $id => $ds)
{
  $inv[] = $ds['u_fb_name'];
  $_SESSION['invite'][$id] = true;
}

$_SESSION['invtext'] = strip_tags($_REQUEST['invtext']);

if (sizeof($inv) == 0)
  $this->redirect('invite', 'party');

?>
<h3>Preview of your invitation</h3>
<br/>
You are inviting: <b><?= implode(', ', $inv) ?></b><br/>
<br/>
Your invitation text:<br/>
<div style="border: 1px solid gray; background: white; padding: 4px; font-family: consolas,courier new; width: 350px;">
<?= nl2br(strip_tags($_REQUEST['invtext'])) ?>
</div>
<br/>
<input type="button" name="btn_submit" value="OK, send invitations!"
  onclick="document.location='<?= actionUrl('send', 'party') ?>';"/>
